<?php
/**
 * Created by PhpStorm.
 * User: 跳梁
 * Date: 2016/4/19
 * Time: 17:42
 */
class securityModule extends Module{
    function __construct(){
        $this->includePhp("security","security");
    }

    public function call($user,$method,$param){
        switch($method){
            case 'index':
                $id = $param->id;
                if(!$id){
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
                security::index($id);
                break;
            case 'verification':
                $id = $param->id;
                $code = $param->code;
                if(!$id&&$code){
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
                security::verification($id,$code);
                break;
        }
    }
}

$module = new securityModule();
Module::addModule($module);